package main

import (
	"fmt"

	"github.com/yourusername/gox"
	"strings"
)

func main() {
	id := 123
	query := func() *gox.Sql {
		__gox_sql_0_builder := gox.NewSqlBuilder()
		__gox_sql_0_builder.AddText(" SELECT * FROM users WHERE 1 = 1 ")
		if __result := func() (__result interface{}) {
			if id > 0 {
				func() string {
					var __parts []string
					__parts = append(__parts, "AND id > #")
					if __codeResult := func() string {
						id
						return ""
					}(); __codeResult != "" {
						__parts = append(__parts, __codeResult)
					}
					if __codeResult := func() string {

						if id > 0 {
							func() string {
								var __parts []string
								__parts = append(__parts, "AND id > #")
								if __codeResult := func() string {
									id
									return ""
								}(); __codeResult != "" {
									__parts = append(__parts, __codeResult)
								}
								return strings.Join(__parts, " ")
							}()
						}

						return ""
					}(); __codeResult != "" {
						__parts = append(__parts, __codeResult)
					}
					return strings.Join(__parts, " ")
				}()
			}
			return __result
		}(); __result != nil {
			__gox_sql_0_builder.AddText(fmt.Sprintf("%v", __result))
		}
		__gox_sql_0 := __gox_sql_0_builder.Build()
		return __gox_sql_0
	}()
	fmt.Println("Query:", query.String())
}
